<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		body{background: #dcdcdc;}
	</style>
</head>
<body>
	
	<form action="index.php?a=index">
		<input type="text" name='s'>
		<input type="submit" value="搜索">
	</form>
	<table border="1" width="100%">
		<tr><td>标题</td>
		<td>留言时间</td></tr>
		<?php foreach($db as $id=>$d):?>
			<tr>
				<td>
					<img src="<?php echo $d['icon'];?>"/>
				<?php echo $d['title'];?>

				<a href="javascript:;" onclick="confirm('确定删除吗')?location.href='index.php?a=del&id=<?php echo $id;?>':''">删除</a>
				<a href="index.php?a=show&id=<?php echo $id;?>">查看</a>
				</td>
				<td><?php echo $d['time'];?></td>
			</tr>
		<?php endforeach;?>
	</table>
	<h1>发表留言</h1>
<form action="?a=post" method="post">
	<table border="1" width="100%">
		<tr>
			<td>标题</td>
			<td>
				<input type="text" name="title">
			</td>
		</tr>
		<tr>
			<td>留言内容</td>
			<td>
				<textarea name="body" cols="30" rows="10"></textarea>
			</td>
		</tr>
		<tr>
			<td>头像</td>
			<td>
				<?php foreach($icons as $icon):?>
					<label>
				<input type="radio" name='icon' value="<?php echo $icon;?>" checked="">
				<img width='50' src="<?php echo $icon;?>" >
				</label>
				<?php endforeach;?> 
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="submit"/>
			</td>
		</tr>
	</table>
</form>














</body>
</html>